<?php

declare(strict_types=1);

use Phinx\Migration\AbstractMigration;

final class CreatePickUpPointTableMigration extends AbstractMigration
{
    /**
     * Change Method.
     *
     * Write your reversible migrations using this method.
     *
     * More information on writing migrations is available here:
     * https://book.cakephp.org/phinx/0/en/migrations.html#the-change-method
     *
     * Remember to call "create()" or "update()" and NOT "save()" when working
     * with the Table class.
     */
    public function change(): void
    {
        $this->table('pick_up_point')
            ->addColumn('name', 'string',['comment' => '自提点名称','null' => true,'limit' =>128,'default' => null])
            ->addColumn('province', 'string',['comment' => '省份','null' => true,'limit' =>64,'default' => null])
            ->addColumn('city', 'string',['comment' => '城市','null' => true,'limit' =>32,'default' => null])
            ->addColumn('area', 'string',['comment' => '区县','null' => true,'limit' =>64,'default' => null])
            ->addColumn('address', 'string',['comment' => '详细地址','null' => true,'limit' =>128,'default' => null])
            ->addColumn('gps', 'string',['comment' => '经纬度','null' => true,'limit' =>64,'default' => null])
            ->addColumn('phone', 'string',['comment' => '联系电话','null' => true,'limit' =>16,'default' => null])
            ->addColumn('city_id', 'integer', ['default' => 0,'limit' => 11,'comment' => '城市id'])
            ->addColumn('status', 'integer', ['default' => 1,'comment' => '状态 1:正常 0:禁用'])
            ->addColumn('created_at', 'integer',['comment' => '创建时间','null' => true,'limit' => 11,'default' => null])
            ->addColumn('updated_at', 'integer',['comment' => '更新时间','null' => true,'limit' => 11,'default' => null])
            ->create();
    }
}
